package mylibrary.designPattern.strategy;

import mylibrary.designPattern.strategy.fly.FlyBehavior;
import mylibrary.designPattern.strategy.quack.QuackBehavior;

public abstract class Duck {

	protected FlyBehavior flyBehavior;
	protected QuackBehavior quackBehavior;
	
	public abstract void display();
	
	public void swim() {
		System.out.println("All ducks float, even decoys!");
	}
	
	public void performFly() {
		flyBehavior.fly();	
	}
	
	public void performQuack() {
		quackBehavior.quack();	
	}
	
	public void setFlyBehavior(FlyBehavior flyBehavior) {
		this.flyBehavior = flyBehavior;
	}
	
	public void setQuackBehavior(QuackBehavior quackBehavior) {
		this.quackBehavior = quackBehavior;
	}
}
